1 /***
2 * QuiltCollector
3 *
4 * This interface is required of
5 * any device which collects coverage
6 * statistics.
7 *
8 * Basically, it provides a common
9 * interface for getting things like
10 * Statistics, Mappings to Source Code,
11 * Reset and other such novelties.
12 *
13 * The idea is, that we build QuiltCollectors
14 * for each Method (or Class), and we instrument
15 * the code.
16 *
17 * How the collector works depends on the
18 * instrumentation, so this needs to be
19 * an interface. This interface is basically
20 * used to provide an interface between
21 * the implementation used, and the reporting
22 * structures.
23 */
24
25 package junit.quilt.framework;
26
27 import java.util.Map;
28 import java.util.Set;
29
30 public interface QuiltCollector
31 {
32 /***
33 * getSummary
34 *
35 * This returns a map of STRING X DOUBLE
36 * where String is one of the constants
37 * defined in this interface (or a custom
38 * constant, for custom coverage metric),
39 * and double is the percentage covered.
40 */
41 public Map getSummary(); // METRIC X VALUE
42
43 /***
44 * getCovered
45 *
46 * This returns a Set of custom objects
47 * regarding what has been covered since
48 * the test has been started.
49 *
50 * NULL is returned if the collector has
51 * no knowledge of the coverage requested.
52 *
53 * @param coverage is one of the Strings
54 * defined in this interface, or a custom
55 * string if the coverage measured is
56 * not defined here.
57 */
58 public Set getCovered( String coverage );
59
60 /***
61 * getUncovered
62 *
63 * This returns a Set of custom objects
64 * regarding what has not been covered since
65 * the test has been started.
66 *
67 * NULL is returned if the collector has
68 * no knowledge of the coverage requested.
69 *
70 * @param coverage is one of the Strings
71 * defined in this interface, or a custom
72 * string if the coverage measured is
73 * not defined here.
74 */
75 public Set getUncovered( String coverage );
76
77 /***
78 * getAll
79 *
80 * This method returns the set of all
81 * possible coverage parts.
82 *
83 * It will return NULL if the particular
84 * coverage is unknown to this collector.
85 *
86 * @param coverage is defined in this interface
87 * or it can be something else if it is not
88 * coded here.
89 */
90 public Set getAll( String coverage );
91
92 /***
93 * getCapabilities
94 *
95 * This returns the set of coverage that this
96 * collector knows about.
97 */
98 public Set getCapabilities();
99
100 /***
101 * reset
102 *
103 * This method is called when the coverage should
104 * be reset.
105 */
106 public void reset();
107
108 public static final String PATH_COVERAGE = "path";
109 public static final String STATEMENT_COVERAGE = "stmt";
110 public static final String BRANCH_COVERAGE = "branch";
111 public static final String RELATIONAL_COVERAGE = "rel";
112 public static final String LOOP_COVERAGE = "loop";
113 }
This page was automatically generated by Maven